#ifndef __utils_h
#define __utils_h
#include "defs.h"
#include "oslib/territory.h"
#include "oslib/messagetrans.h"

#define error_MEMSHORT               1
#define error_TEMPLATE_NOT_FOUND     2
#define error_CANT_FIND_VRAM         3
#define error_NOT_ENOUGH_VRAM        4
#define error_CANT_FIND_GCARD        5
#define error_CANT_START_URI         6
#define error_UNRECOGNISED_PARAMETER 7

#define TERRITORY_MAX_LEN 32

extern territory_t territory;
extern char territory_name[TERRITORY_MAX_LEN];
extern int territory_len;

extern messagetrans_control_block msgs;


os_error *messages_open(const char *dir, int dirlen);
void messages_close(void);
os_error *messages_lookup(char *buf, int size, const char *msgtok,
                          const char *arg0, const char *arg1, const char *arg2, const char *arg3);
os_error *lookup_error(bits err);
os_error *lookup_error1(bits err, const char *arg0);
os_error *lookup_error2(bits err, const char *arg0, const char *arg1);
os_error *lookup_error3(bits err, const char *arg0, const char *arg1, const char *arg2);
os_error *lookup_error4(bits err, const char *arg0, const char *arg1, const char *arg2, const char *arg3);

#ifdef __cplusplus
extern "C" {
#endif
os_error *xscreenblanker_get_delay(int *pdelay_cs);
os_error *xscreenblanker_set_delay(int delay_cs);
#ifdef __cplusplus
};
#endif
#endif
